package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.dto.UserLoginDTO;
import com.sky.entity.User;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper
public interface UserMapper {

    /**
     * 根据openid查询用户信息
     * @param openid
     */
    @Select("select * from user where openid=#{openid}")
    User getByopenid(String openid);

    /**
     * 给用户插入数据
     * @param user
     */
//    @AutoFill(OperationType.INSERT)
    void insert(User user);

    /**
     * 通过用户id查用户
     * @param userId
     * @return
     */
    @Select("select * from user where id=#{userId}")
    User getById(Long userId);

    /**
     * 查询每日新增用户
     * @param map
     * @return
     */
    Integer countByMap(Map map);
}
